import {randomChoice} from "./CommonUtils";
import {RangedWeapons, MeleeWeapons, Armors, PowerArmors, ArmorPieces} from './Equipments'

export default function getNextEquiqment(type) {
    let equiqment;
    switch(type) {
        case 'ranged':
            equiqment = randomChoice(RangedWeapons)
            return {...equiqment}
        case 'melee':
            equiqment = randomChoice(MeleeWeapons)
            return {...equiqment}
        case 'armor':
            equiqment = randomChoice(Armors)
            return {...equiqment, part: randomChoice(ArmorPieces)}
        case 'powerarmor':
            equiqment = randomChoice(PowerArmors)
            return {...equiqment, part: randomChoice(ArmorPieces)}
    }
}

export function getEquipmentListByType(type) {
    switch(type) {
        case 'ranged':
            return RangedWeapons
        case 'melee':
            return MeleeWeapons
        case 'armor':
            return Armors
        case 'powerarmor':
            return PowerArmors
    }
}